<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>03.响应式的底层原理.html</title>
</head>
<body>

    <div id="divNode"></div>



    <script>
        // 真实的数据 
        const _data = {
            name:'小明'
        }
        
        // 代理的数据
        const data = {

        }

        Object.defineProperty(data,"name",{
            get() {
                console.log("获取了这个数据s....");

            },
            set(value) {
                // console.log("设置了这个数据",value);
                _data.name = value;
                divNode.innerHTML = _data.name
            }
        })


        divNode.innerHTML = _data.name


    </script>
    
</body>
</html>